1: | x - 0 | → x | |
2: | s(x) - s(y) | → x - y | |
3: | x * 0 | → 0 | |
4: | x * s(y) | → (x * y) + x | |
5: | if(true,x,y) | → x | |
6: | if(false,x,y) | → y | |
7: | odd(0) | → false | |
8: | odd(s(0)) | → true | |
9: | odd(s(s(x))) | → odd(x) | |
10: | half(0) | → 0 | |
11: | half(s(0)) | → 0 | |
12: | half(s(s(x))) | → s(half(x)) | |
13: | if(true,x,y) | → true | |
14: | if(false,x,y) | → false | |
15: | pow(x,y) | → f(x,y,s(0)) | |
16: | f(x,0,z) | → z | |
17: | f(x,s(y),z) | → if(odd(s(y)),f(x,y,x * z),f(x * x,half(s(y)),z)) | |
18: | s(x) -# s(y) | → x -# y | |
19: | x *# s(y) | → x *# y | |
20: | ODD(s(s(x))) | → ODD(x) | |
21: | HALF(s(s(x))) | → HALF(x) | |
22: | POW(x,y) | → F(x,y,s(0)) | |
23: | F(x,s(y),z) | → IF(odd(s(y)),f(x,y,x * z),f(x * x,half(s(y)),z)) | |
24: | F(x,s(y),z) | → ODD(s(y)) | |
25: | F(x,s(y),z) | → F(x,y,x * z) | |
26: | F(x,s(y),z) | → x *# z | |
27: | F(x,s(y),z) | → F(x * x,half(s(y)),z) | |
28: | F(x,s(y),z) | → x *# x | |
29: | F(x,s(y),z) | → HALF(s(y)) | |